﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace zhihu {
    public partial class FormSetting : Form {
        public FormSetting() {
            InitializeComponent();
        }

        private void FormSetting_Load(object sender, EventArgs e) {
            txtMaxQuestionCount.Text = GlobalInfo.MaxQuestionCount.ToString();
            txtAnswerCount.Text = GlobalInfo.AnswerTimes.ToString();
            txtTopicID.Text = GlobalInfo.TopicID;
        }

        private void btnSave_Click(object sender, EventArgs e) {
            GlobalInfo.MaxQuestionCount = int.Parse(txtMaxQuestionCount.Text.Trim());
            GlobalInfo.AnswerTimes = int.Parse(txtAnswerCount.Text.Trim());
            GlobalInfo.TopicID = txtTopicID.Text.Trim();

            this.DialogResult = DialogResult.OK;
        }

        
    }
}
